<?php
/////////////////////////////////////////////////////////////////////////////////////////////
//	http://net.tutsplus.com/tutorials/wordpress/create-wordpress-plugins-with-oop-techniques/
/////////////////////////////////////////////////////////////////////////////////////////////

class DribbleAPI {
	// url to dribble api
	var $apiUrl = 'http://api.dribbble.com/';
	
	// dribble username or user id
	var $user;
	
	public function __construct($user)
	{
		$this->user = $user;
	}
	
	public function getPlayerShots($perPage = 15)
	{
		$user = $this->user;
		
		$json = wp_remote_get($this->apiUrl . 'players/' . $user . '/shots?per_page=' . $perPage);
		
		$array = json_decode($json['body']);
		
		$shots = $array->shots;
		
		return $shots;
	}
}